# -*- coding:utf-8 -*-
"""
@Time:  2021/7/28 14:29
@Auth:  Mrs.Gou 
@Function:  逻辑运算
"""
# 针对bool值的运算
# not and or
# 非 而且 或
# and：真真为真，有假为假
# or：假假为假，有真为真
# not：取反
b1 = True
b2 = False
print(b1 and b2)
print(b1 or b2)
print(not b1)
x = 1
y = 2
z = 3
print(x < y and x < z)

# not > and > or
b1 = True
b2 = False
# not > and
print(b1 and not b2)
# and > or
print(b1 or b1 and b2)

# 实际上它就是从左到右计算的，短路原则，所以and和or都是按从左到右跑的
# and的短路。所以计算机也不会管b3
print(False and b3)
# or的短路，所以计算机也不会管b3
print(True or b3)
# 短路好处，提升代码效率

# 混合运算  遵循短路原则
x = 1
y = 2
z = 3
b = x > y and x + 2 > 3 or y + 1 > z

























